package main

import "fmt"

func main() {
	a := 10
	fmt.Println("函数调用前的a值：",a)

	b := &a
	change(b)
	fmt.Println("函数调用后的a值：",a)

	c,d:= 100,200
	c,d = swap0(c,d)
	fmt.Println(c,d)

	swap(&c,&d)
	fmt.Println(c,d)

}

func change(num *int)  {
	*num = 20
}

func swap0(x,y int)(int,int){
	return y,x
}

func swap(x,y *int)  {
	*x,*y = *y,*x
}